import 'package:api/pages/provider/provider/model/home_card_model.dart';
import 'package:api/pages/provider/provider/model/home_item_model.dart';
import 'package:api/pages/provider/provider/model/home_tab_model.dart';
import 'package:api/pages/provider/provider/provider_home_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

void main() => runApp(PrividerApp());

class PrividerApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      // 第一步 注册
      providers: [
        ChangeNotifierProvider(
          // 第二步 声明
          create: (BuildContext context) => HomeTabModel(),
        ),
        ChangeNotifierProvider(
          // 第二步 声明
          create: (BuildContext context) => HomeItemModel(),
        ),
        ChangeNotifierProvider(
          // 第二步 声明
          create: (BuildContext context) => HomeCardModel(),
        ),
      ],
      child: MaterialApp(
        title: 'Provider学习',
        home: ProviderHomePage(),
      ),
    );
  }
}
